<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./css/纵向.css">
</head>

<body>
  <div class="box">
    <div class="left">
      <div class="item">女靴</div>
      <div class="item">雪地靴</div>
      <div class="item">冬裙</div>
      <div class="item">女包</div>
      <div class="item">毛衣</div>
      <div class="item">棉服</div>
      <div class="item">女裤</div>
      <div class="item">羽绒服</div>
      <div class="item">皮带</div>
    </div>
    <div class="right">
      <img src="imgs/女靴.jpg" alt="">
      <img src="imgs/雪地靴.jpg" alt="" style="display: none">
      <img src="imgs/冬裙.jpg" alt="" style="display: none">
      <img src="imgs/女包.jpg" alt="" style="display: none">
      <img src="imgs/毛衣.jpg" alt="" style="display: none">
      <img src="imgs/棉服.jpg" alt="" style="display: none">
      <img src="imgs/女裤.jpg" alt="" style="display: none">
      <img src="imgs/羽绒服.jpg" alt="" style="display: none">
      <img src="imgs/皮带.jpg" alt="" style="display: none">
    </div>
  </div>

  <script src="./js/jquery-3.6.0.js"></script>
  <script>
    // 找到元素 --> 注册事件 --> 做什么事
    $('.item').mouseenter(function () {
      // 鼠标移入，让当前的标签，添加背景图
      $(this).css('background', 'url(./imgs/abg.gif)');

      // 鼠标进入，让对应的图片显示，其他兄弟隐藏
      let index = $(this).index();
      $('img').eq(index).show().siblings().hide();
    });

    $('.item').mouseleave(function () {
      // 鼠标离开，让当前的标签去掉背景图
      $(this).css('background', '')
    });
  </script>
</body>

</html>